export default function App() {
  function getNumber(min: number, max: number) {
    const mid = Math.ceil(Math.random() * (max - min))
    return mid
  }
  function getHomeWork() {
    const one = getNumber(0, 9);
    const two = getNumber(0, 9);
    const three = getNumber(0, 99);
    const work = Math.random() > 0.5 ? "+" : "-";
    if (one * two + three)
      if (work === "+") {
        return [one, 'x', two, '+', three];
      } else if (one * two > three) {
        return [one, 'x', two, '-', three];
      } else {
        return [three, '-', one, 'x', two];
      }
  }
  const mid = [];
  for (let i = 0; i < 100; i++) {
    mid.push(getHomeWork());
  }
  return (
    <div style={{paddingLeft:'30px'}}>
      <div style={{ display: "flex", height: '20px', alignItems: 'center' }}>
        <div style={{ flex: '1' }}>姓名：____________ 日期:_____________</div>
        <div style={{ flex: '1' }}>姓名：____________ 日期:_____________</div>
      </div>
      <ul style={{ display: "flex", flexWrap: "wrap" }}>
        {mid.map((item: any) => {
          return (
            <li
              style={{ width: "150px", height: "38px" }}
            >{`${item[0]} ${item[1]} ${item[2]} ${item[3]} ${item[4]} =`}</li>
          );
        })}
      </ul>
    </div>
  );
}
